{
	TFile f("adc_test.root");
	
	TH1F hdt("hdt", "hdt", 140, -20, 120);
	Data->Draw("dt >> hdt");

// 	UShort_t adc_number = 1;
	int toffset	= 0;
	int tcenter	= 9500;
	int tdelta	= 3000;
	int imin	= 0;
	int idelta	= 20;
	
// 	TH1F h22("h22", "h22", 500, 0, 500);
	TH1F h22("h22", "h22", tdelta, (tcenter-tdelta/2), (tcenter+tdelta/2));

// 	TH1F h23("h23", "h23", 500, 0, 500);
	TH1F h23("h23", "h23", tdelta, (tcenter-tdelta/2), (tcenter+tdelta/2));
	h23.SetLineColor(1);
	h22.Sumw2(); h23.Sumw2();
	Data->Draw("adc[2] >> h22", "dt < 23");
	Data->Draw("adc[2] >> h23", "dt >= 23");
	
	TH1F * h[imin+idelta];

	for (int i=imin; i< imin+idelta; i++) {
		stringstream s;
		s << "h" << i;
		//cout << "hist name:" << s.str() << endl;
		h[i] = new TH1F(s.str().c_str(), s.str().c_str(), tdelta, (tcenter-tdelta/2), (tcenter+tdelta/2));
		h[i].Sumw2();
		h[i].SetLineColor(i+1-imin);
		
		stringstream s3;
		s3 << "adc[2] >> " << s.str();
		
		stringstream s2;
		s2 << "dt == " << i + 2;
		Data->Draw(s3.str().c_str(), s2.str().c_str());
	}

// 				h[0]->GetYaxis()->SetRange()
	h[imin]->GetYaxis()->SetRangeUser(0,100);
			
// 	h23.Draw();
	for (int i=imin; i< imin+idelta; i++) {
		if (i==imin)
			h[i].Draw();
		else
			h[i].Draw("same");
	}	
	
	h23.Draw("same");

}
